import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

  const routes = [
    {
      path:"/",
      redirect: "/register"
    },
    {
      path:"/home",
      name:'home',
      component:()=>import("@/views/Home.vue"),
    },
    {
      path:"/register",
      name:'register',
      component:()=>import("@/views/user/register.vue"),
    },
    {
      path:"/infoList",
      name:'infoList',
      component:()=>import("@/views/info/infoList.vue"),
    },
    {
      path:"/message",            // 聊天主路由
      name:'message',
      component:()=>import("@/views/message/messageIndex.vue"),
      children:[
        {
          path:"",            // 聊天首页
          name:'messagelist',
          component:()=>import("@/views/message/MessageList.vue"),
        },
      ]
    },
]

const router = new VueRouter({
  routes
})

export default router
